﻿using System;
using System.Globalization;
using System.Windows.Data;
using Poet.ViewModels;

namespace Poet.Converters
{
    public class GoToLineRangeToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var goToLineViewModel = value as GoToLineViewModel;
            return goToLineViewModel != null
                       ? string.Format("({0}-{1})", goToLineViewModel.MinLineNumber, goToLineViewModel.MaxLineNumber)
                       : null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
